/**
  ******************************************************************************
  * @file    CFG_GetBaudRate.c
  * @author  exatron
  * @version V1.0.0
  * @date    segunda, 22 de dezembro de 2014
  * @brief   Get baudrate serial.
  ******************************************************************************
  * @attention
  *
  *
  ******************************************************************************
  */

/**
  * @addtogroup CFG
  * @{
  */

/* Includes ------------------------------------------------------------------*/
#include <common.h>

/* External functions --------------------------------------------------------*/

/**
  * @defgroup CFG_Functions
  * @{
  */

/**
  * @brief  Get baudrate serial.
  * @param  int baudrate
  * @retval Devolve pela serial Result_t
  */
void CFG_GetBaudRate(SerialType_t serial)
{
	int baudrate;

	baudrate = aux_CFG_GetBaudRate(serial);

	switch(baudrate)
	{
		case B9600:
			baudrate = 9600;
			break;
		case B19200:
			baudrate = 19200;
			break;
		case B38400:
			baudrate = 38400;
			break;
		case B57600:
			baudrate = 57600;
			break;
		case B115200:
			baudrate = 115200;
			break;
		case B230400:
			baudrate = 230400;
			break;
		default:
			baudrate = Result_Error;
	}

	aux_USART0_puts("%s=%d;%d\r\n", "CFG_GBR", serial, baudrate);

	aux_SetBusy(FALSE);
}

/**
  * @}
  */

/**
  * @}
  */


